package common

import (
	"beesoft.ink/application/media/app/g"
	model "beesoft.ink/application/media/app/model/common"
	"github.com/kataras/iris/v12"
)

var Favorite favorite

type favorite struct{}

func (r *favorite) Store(ctx iris.Context, req *model.FavoriteStoreReq) error {
	_, err := g.DB().Insert(&model.Favorite{
		UserId: req.UserId,
		Type:   req.Type,
		Id:     req.Id,
	})
	if err != nil {
		panic(err)
	}

	return nil
}
